package com.aspose.cells;

import java.util.ArrayList;
import java.util.Iterator;

class zub {
   private zol a;
   private zog b;
   private ArrayList c = null;
   private ArrayList d = null;
   private String e = "urn:schemas-microsoft-com:vml";
   private String f = "urn:schemas-microsoft-com:office:office";
   private String g = "urn:schemas-microsoft-com:office:excel";
   private boolean h = false;
   private boolean i = false;
   private boolean j = false;
   private boolean k = false;
   private boolean l = false;
   private boolean m = false;
   private boolean n = false;
   private int o = 0;
   private boolean p = false;
   private zcfx q = null;
   private com.aspose.cells.a.f.zj r = null;
   private String s = null;
   private static final com.aspose.cells.b.c.a.za t = new com.aspose.cells.b.c.a.za(new String[]{"shape", "roundrect", "rect", "shapetype", "shapelayout", "group", "Checkbox", "Label", "Button", "Drop", "Spin", "List", "Radio", "GBox", "Scroll"});

   zub(zol var1) {
      this.a = var1;
      this.b = var1.n;
      this.i = this.b.k;
      this.h = this.b.l;
      this.l = this.b.j;
      this.n = this.b.i;
      this.c = new ArrayList();
      this.d = new ArrayList();
   }

   void a(com.aspose.cells.a.f.zj var1, String var2) throws Exception {
      if (this.i || this.h || this.l || this.n) {
         this.r = var1;
         this.s = var2;
         this.c();
         if (this.q != null) {
            this.q.b();
            this.q.e();
         }

      }
   }

   private void a() throws Exception {
      this.q.c("o:shapelayout", (String)null);
      this.q.a("v:ext", (String)null, "edit");
      this.q.c("o:idmap", (String)null);
      this.q.a("v:ext", (String)null, "edit");
      this.q.a("data", zase.y(this.a.a.getShapes().c().c().a() & '\uffff'));
      this.q.b();
      this.q.b();
   }

   private void b() throws Exception {
      if (this.q == null) {
         this.q = zasr.a(this.s, this.r, true);
         this.q.b("xml");
         this.q.a("xmlns", "v", (String)null, "urn:schemas-microsoft-com:vml");
         this.q.a("xmlns", "o", (String)null, "urn:schemas-microsoft-com:office:office");
         this.q.a("xmlns", "x", (String)null, "urn:schemas-microsoft-com:office:excel");
      }

   }

   private void c() throws Exception {
      if (this.h) {
         this.b();
         zcfw var1 = zasr.a(this.a.e.m, this.a.a.g.d);
         if (null != var1) {
            var1.j();
            if (var1.d()) {
               zbva var2 = new zbva();

               while(var1.r() != 4) {
                  if (var1.r() != 1) {
                     var1.a();
                  } else {
                     zcfq var3 = var1.a((zcft)var2, false);
                     boolean var4 = this.a(var3);
                     if (!var4) {
                        var3.a(this.q);
                     }
                  }
               }

               var1.c();
            }
         }
      }

      if (this.i || this.l || this.n) {
         this.b();
         if (!this.p) {
            this.a();
         }

         if (this.i && !this.j) {
            this.d();
         }

         if (this.n && !this.k) {
            this.e();
         }

         if (this.l && !this.m) {
            this.f();
         }

         this.a(this.b.h);
      }
   }

   private void a(ArrayList var1) throws Exception {
      Iterator var2 = var1.iterator();

      while(true) {
         Comment var5;
         label34:
         do {
            while(var2.hasNext()) {
               zoj var3 = (zoj)var2.next();
               Shape var4 = var3.d;
               switch(var4.getMsoDrawingType()) {
               case 0:
                  this.a((zoh)var3);
                  break;
               case 8:
               case 24:
                  if (this.d.size() <= 0 || !this.d.contains(var4)) {
                     this.a((zoi)var3);
                  }
                  break;
               case 25:
                  var5 = ((CommentShape)var4).a();
                  continue label34;
               default:
                  this.b(var4);
               }
            }

            return;
         } while(this.c.size() > 0 && this.c.contains(var5));

         this.a(var5);
      }
   }

   private void a(zoh var1) throws Exception {
      Shape var2 = var1.d;
      this.q.b("v:group");
      this.q.a("id", var1.e);
      this.q.a("style", this.r(var2));
      this.q.a("coordorigin", zase.y(var2.getLeftToCorner()) + "," + zase.y(var2.getTopToCorner()));
      this.q.a("coordsize", zase.y(var2.getWidth()) + "," + zase.y(var2.getHeight()));
      this.q.d("<o:lock v:ext=\"edit\" text=\"t\"/>");
      this.a(var1.a);
      this.q.b();
   }

   private boolean a(zcfq var1) {
      boolean var2 = false;
      if (var1.e == 1) {
         zcfl var3 = (zcfl)var1;
         String var4;
         switch(t.a(var1.g)) {
         case 0:
         case 1:
         case 2:
            if (this.e(var1)) {
               var2 = true;
            } else if (this.b(var1) || this.c(var1)) {
               var2 = true;
            }
            break;
         case 3:
            var4 = zass.a((zcfl)var1, "id").h;
            if ("\u0000t202".equals(var4)) {
               this.j = true;
            } else if ("\u0000t75".equals(var4)) {
               this.k = true;
            } else if ("\u0000t201".equals(var4)) {
               this.m = true;
            }
            break;
         case 4:
            this.p = true;
            break;
         case 5:
            var4 = zase.a(var1, "id");
            Shape var5 = this.a((String)var4, (String)null);
            if (var5 != null) {
               String var6 = this.r(var5);
               zcfg var7 = zass.a((zcfl)var1, "style");
               if (var7 != null) {
                  var7.h = var6;
               } else {
                  this.a((zcfl)var1, (String)null, "style", var6);
               }
            }

            Iterator var8 = var1.j().iterator();

            while(var8.hasNext()) {
               zcfq var9 = (zcfq)var8.next();
               this.a(var9);
            }
         }
      }

      return var2;
   }

   private double a(double var1) {
      return var1 / 72.0D * 2.54D * 10.0D;
   }

   private zbtz a(Shape var1) throws Exception {
      zbtz var2 = null;
      if (var1.getMsoDrawingType() == 11) {
         var2 = ((CheckBox)var1).aa();
      } else if (var1.getMsoDrawingType() == 14) {
         var2 = ((Label)var1).aa();
      } else if (var1.getMsoDrawingType() == 7) {
         var2 = ((Button)var1).aa();
      } else if (var1.getMsoDrawingType() == 12) {
         var2 = ((RadioButton)var1).aa();
      } else {
         if (var1.getMsoDrawingType() != 19) {
            return null;
         }

         var2 = ((GroupBox)var1).aa();
      }

      MsoTextFrame var3 = var1.getTextFrame();
      String var4 = null;
      if (!var3.isAutoMargin()) {
         var4 = zase.b(this.a(var3.getLeftMarginPt())) + "mm," + zase.b(this.a(var3.getTopMarginPt())) + "mm," + zase.b(this.a(var3.getRightMarginPt())) + "mm," + zase.b(this.a(var3.getBottomMarginPt())) + "mm";
      }

      this.q.c("v", "textbox", this.e);
      String var5 = "mso-direction-alt:auto";
      if (var1.getTextFrame().getAutoSize()) {
         var5 = var5 + ";mso-fit-shape-to-text:t";
      }

      this.q.a("style", var5);
      if (var4 != null) {
         this.q.a("inset", var4);
      }

      this.q.a("o", "singleclick", this.f, "f");
      this.q.b("div");
      this.q.a("style", "text-align:left");
      this.q.a("o", "singleclick", this.f, "f");
      Font var6 = var2.k();
      if (var2.p() != null && var2.p().size() > 0) {
         int var7 = var2.p().size();

         for(int var8 = 0; var8 < var7; ++var8) {
            FontSetting var9 = (FontSetting)var2.p().get(var8);
            Font var10 = var9.c();
            if (var10 == null) {
               var10 = var6;
            }

            if (var8 == 0 && var9.getStartIndex() != 0) {
               this.a(var6, var2.i().substring(0, 0 + var9.getStartIndex()));
            }

            this.a(var10, var2.i().substring(var9.getStartIndex(), var9.getStartIndex() + var9.getLength()));
            if (var8 == var7 - 1) {
               int var11 = var9.getStartIndex() + var9.getLength();
               int var12 = var2.i().length() - var11;
               if (var12 > 0) {
                  this.a(var6, var2.i().substring(var11, var11 + var12));
               }
            }
         }
      } else if (var2.i() != null) {
         this.a(var6, var2.i());
      }

      this.q.b();
      this.q.b();
      return var2;
   }

   private void a(Font var1, String var2) throws Exception {
      this.q.b("font");
      this.q.a("face", var1.getName());
      this.q.a("size", zase.y(var1.getSize() * 20));
      String var3 = "auto";
      if (!var1.b.a()) {
         var3 = zase.y(var1.b());
      }

      this.q.a("color", var3);
      this.q.a(var2, true);
      this.q.b();
   }

   private void b(Shape var1) throws Exception {
      int var2 = var1.getMsoDrawingType();
      this.q.c("v", "shape", this.e);
      this.c(var1);
      this.p(var1);
      if (var1.getLineFormat().isVisible()) {
         this.q.c("v", "stroke", this.e);
         this.q.a("dashstyle", zase.p(var1.getLineFormat().getDashStyle()));
         this.q.a("linestyle", zase.o(var1.getLineFormat().getStyle()));
         this.q.b();
      }

      if (var2 == 11 || var2 == 12) {
         this.q.c("v", "path", this.e);
         this.q.a("shadowok", "t");
         this.q.a("strokeok", "t");
         this.q.a("fillok", "t");
         this.q.b();
      }

      this.q.c("o", "lock", this.f);
      this.q.a("v", "ext", this.e, "edit");
      this.q.a("rotation", "t");
      if (var2 == 7 || var2 == 20 || var2 == 18 || var2 == 17 || var2 == 16) {
         this.q.a("text", "t");
      }

      this.q.b();
      zbtz var3 = this.a(var1);
      this.a(var1, var3);
      this.q.b();
   }

   private void c(Shape var1) throws Exception {
      int var2 = var1.getMsoDrawingType();
      String var3 = this.n(var1);
      if (var3 != null) {
         this.q.a("id", var3);
      }

      String var4 = this.o(var1);
      if (var4 != null) {
         this.q.a("o", "spid", this.f, var4);
      }

      this.q.a("type", "#\u0000t201");
      Hyperlink var5 = var1.getHyperlink();
      if (var5 != null) {
         this.q.a("href", var5.getAddress());
      }

      this.q.a("style", this.r(var1));
      String var6;
      if (var2 == 7) {
         this.q.a("o", "button", this.f, "t");
      } else if (var2 != 18 && var2 != 17) {
         var6 = var1.getFillFormat() != null && var1.getFillFormat().isVisible() ? "t" : "f";
         this.q.a("filled", var6);
      }

      if (var2 != 18 && var2 != 17) {
         this.q.a("fillcolor", this.m(var1));
      }

      var6 = "t";
      if (!var1.getLineFormat().isVisible()) {
         var6 = "f";
      }

      this.q.a("stroked", var6);
      if (var1.getLineFormat().isVisible()) {
         this.q.a("strokecolor", this.l(var1));
         this.q.a("strokeweight", zase.b(var1.getLineFormat().getWeight()) + "pt");
      }

      if (var1.q) {
         this.q.a("o", "insetmode", this.f, "auto");
      }

   }

   private void a(Shape var1, zbtz var2) throws Exception {
      int var3 = var1.getMsoDrawingType();
      this.q.c("x", "ClientData", this.g);
      String var4 = this.k(var1);
      this.q.a("ObjectType", var4);
      if (var1.S()) {
         this.q.d("<x:DefaultSize/>");
      } else {
         if (var1.getPlacement() == 0) {
            this.q.b("x", "MoveWithCells", this.g, (String)null);
         }

         if (var1.getPlacement() == 0 || var1.getPlacement() == 1) {
            this.q.b("x", "SizeWithCells", this.g, (String)null);
         }

         this.q.b("x", "Anchor", this.g, this.q(var1));
      }

      if (!var1.isLocked()) {
         this.q.b("x", "Locked", this.g, "False");
      }

      if (!var1.isPrintable()) {
         this.q.b("x", "PrintObject", this.g, "False");
      }

      if (var3 != 16 && var3 != 17) {
         this.q.b("x", "AutoFill", this.g, "False");
         if (var3 != 18 && var3 != 19) {
            this.q.b("x", "AutoLine", this.g, "False");
         }
      }

      if (var1.v() != null) {
         this.q.b("x", "FmlaMacro", this.g, var1.v());
      }

      if (var3 != 19) {
         this.a(var2);
      }

      if (var3 == 11) {
         this.j(var1);
      }

      if (var1.X() != null) {
         String var5 = "FmlaLink";
         if (var3 == 7 || var3 == 19) {
            var5 = "FmlaTxbx";
         }

         this.q.b("x", var5, this.g, var1.getLinkedCell());
      }

      this.g(var1);
      if (var3 == 20) {
         this.i(var1);
      } else if (var3 == 16) {
         this.h(var1);
      } else if (var3 == 18) {
         this.f(var1);
      } else if (var3 == 12) {
         this.d(var1);
      } else if (var3 == 17) {
         this.e(var1);
      }

      this.q.b();
   }

   private void d(Shape var1) throws Exception {
      RadioButton var2 = (RadioButton)var1;
      if (var2.isChecked()) {
         this.q.b("x", "Checked", this.g, "1");
      }

   }

   private void e(Shape var1) throws Exception {
      ScrollBar var2 = (ScrollBar)var1;
      this.q.b("x", "Val", this.g, zase.y(var2.getCurrentValue()));
      this.q.b("x", "Min", this.g, zase.y(var2.getMin()));
      this.q.b("x", "Max", this.g, zase.y(var2.getMax()));
      this.q.b("x", "Inc", this.g, zase.y(var2.getIncrementalChange()));
      this.q.b("x", "Page", this.g, zase.y(var2.getPageChange()));
      if (var2.isHorizontal()) {
         this.q.b("x", "Horiz", this.g, (String)null);
      }

      this.q.b("x", "Dx", this.g, "15");
   }

   private void f(Shape var1) throws Exception {
      ListBox var2 = (ListBox)var1;
      this.q.b("x", "Val", this.g, zase.y(var2.b()));
      this.q.b("x", "Min", this.g, zase.y(var2.c()));
      this.q.b("x", "Max", this.g, zase.y(var2.d()));
      this.q.b("x", "Inc", this.g, zase.y(var2.e()));
      this.q.b("x", "Page", this.g, zase.y(var2.getPageChange()));
      this.q.b("x", "Dx", this.g, zase.y(15));
      String var3 = var2.getInputRange();
      if (var3 != null) {
         this.q.b("x", "FmlaRange", this.g, var3);
      }

      int var4 = var2.getSelectedIndex() + 1;
      this.q.b("x", "Sel", this.g, zase.y(var4));
      if (!var2.getShadow()) {
         this.q.b("x", "NoThreeD2", this.g, (String)null);
      }

      this.q.b("x", "SelType", this.g, zase.ap(var2.getSelectionType()));
      if (var2.getSelectionType() != 0 && var2.a() != null && var2.a().size() > 0) {
         StringBuilder var5 = new StringBuilder(com.aspose.cells.b.a.zo.a(((Integer)var2.a().get(0) & '\uffff') + 1));

         for(int var6 = 1; var6 < var2.a().size(); ++var6) {
            var5.append(", ").append(com.aspose.cells.b.a.zo.a(((Integer)var2.a().get(var6) & '\uffff') + 1));
         }

         this.q.b("x", "MultiSel", this.g, com.aspose.cells.b.a.zr.a(var5));
      }

      this.q.b("x", "LCT", this.g, "Normal");
   }

   private void g(Shape var1) throws Exception {
      int var2 = var1.getMsoDrawingType();
      if (var2 == 11) {
         CheckBox var3 = (CheckBox)var1;
         if (!var3.getShadow()) {
            this.q.b("x", "NoThreeD", this.g, (String)null);
         }
      } else if (var2 == 16) {
         Spinner var4 = (Spinner)var1;
         if (!var4.getShadow()) {
            this.q.b("x", "NoThreeD", this.g, (String)null);
         }
      } else if (var2 == 12) {
         RadioButton var5 = (RadioButton)var1;
         if (!var5.getShadow()) {
            this.q.b("x", "NoThreeD", this.g, (String)null);
         }
      } else if (var2 == 19) {
         GroupBox var6 = (GroupBox)var1;
         if (!var6.getShadow()) {
            this.q.b("x", "NoThreeD", this.g, (String)null);
         }
      }

   }

   private void h(Shape var1) throws Exception {
      Spinner var2 = (Spinner)var1;
      this.q.b("x", "Val", this.g, zase.y(var2.getCurrentValue()));
      this.q.b("x", "Min", this.g, zase.y(var2.getMin()));
      this.q.b("x", "Max", this.g, zase.y(var2.getMax()));
      this.q.b("x", "Inc", this.g, zase.y(var2.getIncrementalChange()));
      this.q.b("x", "Page", this.g, zase.y(var2.a()));
      this.q.b("x", "Dx", this.g, zase.y(15));
   }

   private void i(Shape var1) throws Exception {
      ComboBox var2 = (ComboBox)var1;
      this.q.b("x", "Inc", this.g, zase.y(1));
      this.q.b("x", "Dx", this.g, zase.y(15));
      String var3 = var2.getInputRange();
      if (var3 != null) {
         this.q.b("x", "FmlaRange", this.g, var3);
      }

      int var4 = Math.max(0, var2.getSelectedIndex() + 1);
      this.q.b("x", "Sel", this.g, zase.y(var4));
      if (!var2.getShadow()) {
         this.q.b("x", "NoThreeD2", this.g, (String)null);
      }

      this.q.b("x", "LCT", this.g, "Normal");
      if (var2.a != null) {
         int var5 = var2.a.length;

         for(int var6 = 0; var6 < var5; ++var6) {
            String var7 = var2.a[var6];
            this.q.b("x", "ListItem", this.g, var7);
         }
      }

      this.q.b("x", "DropStyle", this.g, "Combo");
      this.q.b("x", "DropLines", this.g, zase.y(var2.getDropDownLines()));
   }

   private void j(Shape var1) throws Exception {
      CheckBox var2 = (CheckBox)var1;
      if (var2.a() != 0) {
         String var3 = "1";
         if (var2.a() == 2) {
            var3 = "2";
         }

         this.q.b("x", "Checked", this.g, var3);
      }

   }

   private void a(zbtz var1) throws Exception {
      if (var1 != null) {
         String var2;
         if (var1.h() != 5) {
            var2 = zase.ad(var1.h());
            if (var2 != null) {
               this.q.b("x", "TextVAlign", this.g, var2);
            }
         }

         if (var1.g() != 5) {
            var2 = zase.ad(var1.g());
            if (var2 != null) {
               this.q.b("x", "TextHAlign", this.g, var2);
            }
         }
      }

   }

   private String k(Shape var1) {
      switch(var1.getMsoDrawingType()) {
      case 7:
         return "Button";
      case 8:
      case 9:
      case 10:
      case 13:
      case 15:
      default:
         return null;
      case 11:
         return "Checkbox";
      case 12:
         return "Radio";
      case 14:
         return "Label";
      case 16:
         return "Spin";
      case 17:
         return "Scroll";
      case 18:
         return "List";
      case 19:
         return "GBox";
      case 20:
         return "Drop";
      }
   }

   private void a(Comment var1) throws Exception {
      CommentShape var2 = var1.getCommentShape();
      this.q.c("v", "shape", this.e);
      String var3 = this.n(var2);
      if (var3 != null) {
         this.q.a("id", var3);
      }

      String var4 = this.m(var2);
      String var5 = this.l(var2);
      this.q.a("type", "#\u0000t202");
      this.q.a("style", this.r(var2));
      this.q.a("fillcolor", var4);
      if (var2.getLineFormat().isVisible()) {
         this.q.a("strokecolor", var5);
         this.q.a("strokeweight", zase.b(var2.getLineFormat().getWeight()) + "pt");
      }

      this.q.a("o", "insetmode", this.f, "auto");
      this.p(var2);
      if (var2.getLineFormat().isVisible()) {
         this.q.c("v", "stroke", this.e);
         this.q.a("dashstyle", zase.p(var2.getLineFormat().getDashStyle()));
         this.q.a("linestyle", zase.o(var2.getLineFormat().getStyle()));
         this.q.b();
      }

      this.q.c("v", "shadow", this.e);
      this.q.a("on", "t");
      this.q.a("color", "silver");
      this.q.a("opacity", ".5");
      this.q.a("obscured", "t");
      this.q.b();
      this.q.c("v", "path", this.e);
      this.q.a("o", "connecttype", this.f, "none");
      this.q.b();
      this.q.c("v", "textbox", this.e);
      String var6 = "auto";
      switch(var1.getCommentShape().getTextDirection()) {
      case 1:
         var6 = "LTR";
         break;
      case 2:
         var6 = "RTL";
      }

      String var7 = "mso-direction-alt:" + var6;
      if (var2.getTextFrame().getAutoSize()) {
         var7 = var7 + ";mso-fit-shape-to-text:t";
      }

      this.q.a("style", var7);
      this.q.b("div");
      String var8 = "left";
      if (var1.getTextHorizontalAlignment() != 5) {
         var8 = zase.ad(var1.getTextHorizontalAlignment());
      }

      this.q.a("style", "text-align:" + var8);
      this.q.b();
      this.q.b();
      this.q.c("x", "ClientData", this.g);
      this.q.a("ObjectType", "Note");
      switch(var2.getPlacement()) {
      case 0:
         this.q.d("<x:MoveWithCells/>");
         this.q.d("<x:SizeWithCells/>");
         break;
      case 1:
         this.q.d("<x:SizeWithCells/>");
      }

      this.q.b("x", "Anchor", this.g, this.q(var2));
      if (var1.getTextHorizontalAlignment() != 5) {
         this.q.b("x", "TextHAlign", this.g, var8);
      }

      if (var1.getTextVerticalAlignment() != 5) {
         var8 = zase.ad(var1.getTextVerticalAlignment());
         this.q.b("x", "TextVAlign", this.g, var8);
      }

      this.q.b("x", "Row", this.g, zase.y(var1.getRow()));
      this.q.b("x", "Column", this.g, zase.y(var1.getColumn()));
      this.q.b();
      this.q.b();
   }

   private String l(Shape var1) {
      return !var1.getLineFormat().isVisible() ? null : "#" + zase.a(var1.getLineFormat().getForeColor());
   }

   private String m(Shape var1) {
      String var2 = null;
      int var3 = var1.getMsoDrawingType();
      if (var3 != 18 && var3 != 17) {
         if (var1.getFill().getType() == 2) {
            Color var4 = var1.getFill().getSolidFill().getColor();
            if (var4.isEmpty()) {
               var2 = "window [65]";
            } else {
               var2 = "#" + zase.a(var4);
            }
         } else if (var3 == 7) {
            var2 = "buttonFace [67]";
         } else {
            var2 = "window [65]";
         }

         return var2;
      } else {
         return null;
      }
   }

   private String n(Shape var1) {
      String var2 = null;
      if (var1.g != null) {
         var2 = var1.g.a;
      }

      String var3 = var1.N().c().e(50048);
      if (var3 != null && !"".equals(var3)) {
         var2 = var3;
      }

      if (var1.getMsoDrawingType() == 24) {
         return zcfi.a(var2);
      } else {
         if (var2 == null) {
            var2 = var1.getName();
         }

         return zcfi.a(var2);
      }
   }

   private String o(Shape var1) {
      return var1.g != null ? zcfi.a(var1.g.b) : null;
   }

   private void p(Shape var1) throws Exception {
      String var2 = this.a.n.a(var1);
      if (var1.getMsoDrawingType() == 24) {
         this.q.c("v", "fill", this.e);
         if (var2 != null) {
            this.q.a("o", "relid", this.f, var2);
         }

         this.q.a("color2", "window [65]");
         if (var2 != null) {
            this.q.a("type", "frame");
         }

         this.q.b();
      } else if (var1.getMsoDrawingType() == 25) {
         this.q.c("v", "fill", this.e);
         if (var2 != null) {
            this.q.a("o", "relid", this.f, var2);
         }

         if (var1.getFillFormat().a() != 1.0D) {
            this.q.a("opacity", zase.b(var1.getFillFormat().a()));
         }

         this.q.a("color2", this.m(var1));
         if (var2 != null) {
            this.q.a("type", "frame");
         }

         this.q.b();
      } else if (var1.getMsoDrawingType() == 7) {
         this.q.c("v", "fill", this.e);
         this.q.a("color2", "buttonFace [67]");
         this.q.a("o", "detectmouseclick", this.f, "t");
         this.q.b();
      } else if (var2 != null || var1.getFillFormat().a() != 1.0D) {
         this.q.c("v", "fill", this.e);
         if (var2 != null) {
            this.q.a("o", "relid", this.f, var2);
         }

         if (var1.getFillFormat().a() != 1.0D) {
            this.q.a("opacity", zase.b(var1.getFillFormat().a()));
         }

         if (var2 != null) {
            this.q.a("type", "frame");
         }

         this.q.b();
      }

   }

   private void a(zoi var1) throws Exception {
      Shape var2 = var1.d;
      this.q.c("v", "shape", this.e);
      this.q.a("id", var1.e);
      if (var1.f != null) {
         this.q.a("o", "spid", this.f, var1.f);
      }

      this.q.a("type", var1.h);
      String var3 = var2.getAlternativeText();
      if (var3 != null && !"".equals(var3)) {
         this.q.a("alt", var3);
      }

      Hyperlink var4 = var2.getHyperlink();
      if (var4 != null) {
         this.q.a("href", var4.getAddress());
      }

      this.q.a("style", this.r(var2));
      this.q.a("filled", var2.getFillFormat().isVisible() ? "t" : "f");
      this.q.a("fillcolor", this.m(var2));
      if (var2.getLineFormat().isVisible()) {
         this.q.a("stroked", "t");
         this.q.a("strokecolor", this.l(var2));
         if (var2.g != null && var2.g.k != null && var2.g.k.a(1073741824L)) {
            this.q.a("strokeweight", zase.b(var2.getLineFormat().getWeight()) + "pt");
         }
      }

      this.q.a("o", "insetmode", this.f, "auto");
      this.p(var2);
      if (var2.getLineFormat().isVisible()) {
         this.q.c("v", "stroke", this.e);
         this.q.a("dashstyle", zase.p(var2.getLineFormat().getDashStyle()));
         this.q.a("linestyle", zase.o(var2.getLineFormat().getStyle()));
         this.q.b();
      }

      if (var1.a != null) {
         this.q.c("v", "imagedata", this.e);
         this.q.a("o", "relid", this.f, var1.a);
         this.q.a("o", "title", this.f, "");
         double var5 = var2.getFormatPicture().getTopCrop();
         if (var5 != 0.0D) {
            this.q.a("o", "croptop", this.f, (int)(var5 * 65536.0D) + "f");
         }

         var5 = var2.getFormatPicture().getBottomCrop();
         if (var5 != 0.0D) {
            this.q.a("o", "cropbottom", this.f, (int)(var5 * 65536.0D) + "f");
         }

         var5 = var2.getFormatPicture().getLeftCrop();
         if (var5 != 0.0D) {
            this.q.a("o", "cropleft", this.f, (int)(var5 * 65536.0D) + "f");
         }

         var5 = var2.getFormatPicture().getRightCrop();
         if (var5 != 0.0D) {
            this.q.a("o", "cropright", this.f, (int)(var5 * 65536.0D) + "f");
         }

         if (var2.g != null) {
            if (var2.g.l != null) {
               this.q.a("gain", var2.g.l);
            }

            if (var2.g.m != null) {
               this.q.a("blacklevel", var2.g.m);
            }
         }

         this.q.b();
      }

      if (var2.getMsoDrawingType() == 8 && ((Picture)var2).b != null) {
         this.a(this.q, ((Picture)var2).b);
      }

      this.q.c("x", "ClientData", this.g);
      this.q.a("ObjectType", "Pict");
      if (!var1.d.S()) {
         if (var2.getPlacement() == 0) {
            this.q.b("x", "MoveWithCells", this.g, (String)null);
         }

         if (var2.getPlacement() == 0 || var2.getPlacement() == 1) {
            this.q.b("x", "SizeWithCells", this.g, (String)null);
         }

         this.q.b("x", "Anchor", this.g, this.q(var2));
      }

      if (var2.v() != null) {
         this.q.b("x", "FmlaMacro", this.g, var2.v());
      }

      if (var2.ac() != null) {
         this.q.b("x", "FmlaPict", this.g, var2.ac());
      }

      if (var2.x != null) {
         String var7 = var2.getLinkedCell();
         if (var7 != null) {
            this.q.b("x", "FmlaLink", this.g, var7);
         }

         var7 = var2.getInputRange();
         if (var7 != null) {
            this.q.b("x", "FmlaRange", this.g, var7);
         }
      }

      if (var1.a != null) {
         this.q.b("x", "CF", this.g, "Pict");
      } else {
         this.q.b("x", "DDE", this.g, (String)null);
      }

      if (var2.ac() != null) {
         this.q.b("x", "Camera", this.g, (String)null);
      }

      if (var2.getMsoDrawingType() == 24 && ((OleObject)var2).isAutoSize()) {
         this.q.b("x", "AutoPict", this.g, (String)null);
      }

      this.q.b();
      this.q.b();
   }

   private String q(Shape var1) {
      int var2 = var1.L().M();
      int[] var3 = var1.I();
      StringBuilder var4 = new StringBuilder();
      var4.append(zase.y(var3[0]));

      for(int var5 = 1; var5 < var3.length; ++var5) {
         var4.append(',');
         if (var5 % 2 == 1) {
            var4.append(zase.y(zase.a(var3[var5], var2)));
         } else {
            var4.append(zase.y(var3[var5]));
         }
      }

      return com.aspose.cells.b.a.zr.a(var4);
   }

   private String r(Shape var1) {
      String var2 = null;
      if (var1.P()) {
         Chart var3 = (Chart)((Chart)((ShapeCollection)var1.F()).h());
         ChartShape var4 = var3.getChartObject();
         Cells var5 = var1.M().getCells();
         int var6 = (int)((double)var4.getLeftToCorner() + (double)(var1.getLeftInShape() * var4.getWidth()) / 4000.0D + 0.5D);
         int var7 = (int)((double)var4.getTopToCorner() + (double)(var1.getTopInShape() * var4.getHeight()) / 4000.0D + 0.5D);
         int var8 = (int)((double)(var1.getWidthInShape() * var4.getWidth()) / 4000.0D + 0.5D);
         int var9 = (int)((double)(var1.getHeightInShape() * var4.getHeight()) / 4000.0D + 0.5D);
         var2 = "position:absolute;margin-left:" + zase.y(var6) + "px;margin-top:" + zase.y(var7) + "px;width:" + zase.y(var8) + "px;height:" + zase.y(var9) + "px;z-index:" + this.s(var1) + ";";
      } else {
         var2 = "position:absolute;margin-left:" + zase.y(var1.getLeftToCorner()) + "px;margin-top:" + zase.y(var1.getTopToCorner()) + "px;width:" + zase.y(var1.getWidth()) + "px;height:" + zase.y(var1.getHeight()) + "px;z-index:" + this.s(var1) + ";";
      }

      if (var1.getMsoDrawingType() == 25) {
         Comment var10 = ((CommentShape)var1).a();
         if (var10.isVisible()) {
            var2 = var2 + " visibility:visible;";
         } else {
            var2 = var2 + " visibility:hidden;";
         }
      } else if (var1.isHidden()) {
         var2 = var2 + " visibility:hidden;";
      }

      if (var1.getMsoDrawingType() == 7) {
         var2 = var2 + "mso-wrap-style:tight";
      }

      return var2;
   }

   private int s(Shape var1) {
      if (var1.g != null && var1.g.d != -1) {
         if (this.o <= var1.g.d) {
            this.o = var1.g.d + 1;
         }

         return var1.g.d;
      } else {
         return this.o++;
      }
   }

   private void d() throws Exception {
      this.q.c("v", "shapetype", this.e);
      this.q.a("id", "\u0000t202");
      this.q.a("coordsize", "21600,21600");
      this.q.a("o", "spt", this.f, "202");
      this.q.a("path", "m,l,21600r21600,l21600,xe");
      this.q.c("v", "stroke", this.e);
      this.q.a("joinstyle", "miter");
      this.q.b();
      this.q.c("v", "path", this.e);
      this.q.a("gradientshapeok", "t");
      this.q.a("o", "connecttype", this.f, "rect");
      this.q.b();
      this.q.b();
   }

   private void e() throws Exception {
      this.q.c("v", "shapetype", this.e);
      this.q.a("id", "\u0000t75");
      this.q.a("coordsize", "21600,21600");
      this.q.a("o", "spt", this.f, "75");
      this.q.a("o", "preferrelative", this.f, "t");
      this.q.a("path", "m@4@5l@4@11@9@11@9@5xe");
      this.q.a("filled", "f");
      this.q.a("stroked", "f");
      this.q.c("v", "stroke", this.e);
      this.q.a("joinstyle", "miter");
      this.q.b();
      this.q.c("v", "formulas", this.e);
      this.a("if lineDrawn pixelLineWidth 0");
      this.a("sum @0 1 0");
      this.a("sum 0 0 @1");
      this.a("prod @2 1 2");
      this.a("prod @3 21600 pixelWidth");
      this.a("prod @3 21600 pixelHeight");
      this.a("sum @0 0 1");
      this.a("prod @6 1 2");
      this.a("prod @7 21600 pixelWidth");
      this.a("sum @8 21600 0");
      this.a("prod @7 21600 pixelHeight");
      this.a("sum @10 21600 0");
      this.q.b();
      this.q.d("<v:path o:extrusionok=\"f\" gradientshapeok=\"t\" o:connecttype=\"rect\"/>");
      this.q.d("<o:lock v:ext=\"edit\" aspectratio=\"t\"/>");
      this.q.b();
   }

   private void f() throws Exception {
      this.q.c("v", "shapetype", this.e);
      this.q.a("id", "\u0000t201");
      this.q.a("coordsize", "21600,21600");
      this.q.a("o", "spt", this.f, "201");
      this.q.a("path", "m,l,21600r21600,l21600,xe");
      this.q.c("v", "stroke", this.e);
      this.q.a("joinstyle", "miter");
      this.q.b();
      this.q.c("v", "path", this.e);
      this.q.a("shadowok", "f");
      this.q.a("o", "extrusionok", this.f, "f");
      this.q.a("strokeok", "f");
      this.q.a("fillok", "f");
      this.q.a("o", "connecttype", this.f, "rect");
      this.q.b();
      this.q.c("o", "lock", this.f);
      this.q.a("v", "ext", this.e, "edit");
      this.q.a("shapetype", "t");
      this.q.b();
      this.q.b();
   }

   private void a(String var1) throws Exception {
      this.q.c("v", "f", this.e);
      this.q.a("eqn", var1);
      this.q.b();
   }

   private boolean b(zcfq var1) {
      zcfl var2 = zase.b(var1, "ClientData");
      if (var2 != null) {
         String var3 = zase.a((zcfq)var2, (String)"ObjectType");
         if (this.b(var3)) {
            return true;
         }
      }

      zcfg var5 = zass.a((zcfl)var1, "id");
      if (var5 != null) {
         String var4 = zase.b(var5.h);
         if (this.a.a.g.n.contains(var4)) {
            return true;
         }
      }

      return false;
   }

   private boolean b(String var1) {
      if (var1 == null) {
         return false;
      } else {
         switch(t.a(var1)) {
         case 6:
         case 7:
         case 8:
         case 9:
         case 10:
         case 11:
         case 12:
         case 13:
         case 14:
            return true;
         default:
            return false;
         }
      }
   }

   private boolean c(zcfq var1) {
      zcfl var2 = null;
      boolean var3 = false;
      zcfs var4 = var1.j();

      for(int var5 = 0; var5 < var4.a(); ++var5) {
         if (var4.a(var5) instanceof zcfl) {
            zcfl var6 = (zcfl)var4.a(var5);
            if ("textbox".equals(var6.g)) {
               var2 = var6;
            }

            if ("ClientData".equals(var6.g) && var6.e().getCount() > 0) {
               zcfg var7 = zass.a(var6, "ObjectType");
               if (var7 != null && "Note".equals(var7.h)) {
                  String var8 = null;
                  String var9 = null;
                  zcfl var10 = null;
                  zcfl var11 = null;
                  zcfs var12 = var6.j();

                  int var13;
                  for(var13 = 0; var13 < var12.a(); ++var13) {
                     if (var12.a(var13) instanceof zcfl) {
                        zcfl var14 = (zcfl)var12.a(var13);
                        if ("Row".equals(var14.g)) {
                           var8 = zass.a((zcfq)var14);
                           var11 = var14;
                        } else if ("Column".equals(var14.g)) {
                           var9 = zass.a((zcfq)var14);
                        } else if ("Anchor".equals(var14.g)) {
                           var10 = var14;
                        }
                     }
                  }

                  if (var8 != null && var9 != null && var8.length() != 0 && var9.length() != 0) {
                     var13 = zase.C(var8);
                     int var16 = zase.C(var9);
                     Comment var15 = this.a.a.getComments().get(var13, var16);
                     if (var15 == null) {
                        var3 = true;
                     } else {
                        this.a(var1, var6, var10, var11, var2, var15);
                        com.aspose.cells.b.a.a.ze.a(this.c, (Object)var15);
                     }
                  } else {
                     var3 = true;
                  }
               }
            }
         }
      }

      return var3;
   }

   private String d(zcfq var1) {
      zcfs var2 = var1.j();

      for(int var3 = 0; var3 < var2.a(); ++var3) {
         if (var2.a(var3) instanceof zcfl) {
            zcfl var4 = (zcfl)var2.a(var3);
            if ("ClientData".equals(var4.g)) {
               return zase.a((zcfq)var4, (String)"ObjectType");
            }
         }
      }

      return null;
   }

   private boolean e(zcfq var1) {
      String var2 = this.d(var1);
      if (!"Pict".equals(var2)) {
         return false;
      } else {
         String var3 = zase.b(zase.a(var1, "id"));
         zcfg var4 = zass.a((zcfl)var1, "spid");
         String var5 = var4 == null ? null : var4.h;
         String var6 = var3 + "|" + var5;
         if (!this.a.a.g.p.contains(var6)) {
            return false;
         } else {
            Shape var7 = this.a(var3, var5);
            if (var7 == null) {
               return true;
            } else {
               if (var7.g.c != null) {
                  var4.h = var7.g.b;
               }

               zcfl var8 = zase.b((zcfq)((zcfl)var1), "ClientData");
               if (var8 != null) {
                  zcfl var9;
                  if (var7.getMsoDrawingType() == 8) {
                     var9 = zase.b((zcfq)((zcfl)var1), "imagedata");
                     zcfg var10 = zass.a(var9, "relid");
                     var10.h = (String)this.a.n.d.get(((Picture)var7).b());
                     if (((Picture)var7).getSignatureLine() != null) {
                        zcfl var11 = zase.b((zcfq)((zcfl)var1), "signatureline");
                        if (var11 == null) {
                           var11 = new zcfl(var1);
                           var11.i = "signatureline";
                           var11.f = "o";
                           var11.a(var11);
                        }

                        this.a(var11, ((Picture)var7).getSignatureLine());
                     }
                  }

                  var9 = zase.b((zcfq)var8, "Anchor");
                  zcfl var14 = zase.b((zcfq)var8, "FmlaPict");
                  String var15 = this.r(var7);
                  zcfg var12 = zass.a((zcfl)var1, "style");
                  if (var12 != null) {
                     var12.h = var15;
                  } else {
                     this.a((zcfl)var1, (String)null, "style", var15);
                  }

                  String var13 = this.q(var7);
                  if (var9 != null) {
                     zass.a((zcfq)var9, var13);
                  }

                  if (var14 != null && var7.ac() != null && var7.ac().length() > 0) {
                     com.aspose.cells.b.a.a.ze.a(this.d, (Object)var7);
                     zass.a((zcfq)var14, var7.ac());
                  }
               }

               return false;
            }
         }
      }
   }

   private void a(zcfl var1, SignatureLine var2) {
      var1.e().clear();
      if (var2.d != null) {
         this.a(var1, (String)null, "addlxml", var2.d);
      }

      if (var2.getAllowComments()) {
         this.a(var1, (String)null, "allowcomments", "t");
      }

      if (var2.a != null) {
         this.a(var1, "v", "ext", var2.a);
      }

      this.a(var1, (String)null, "id", zase.a(var2.b.a()));
      this.a(var1, (String)null, "issignatureline", var2.isLine() ? "t" : "f");
      this.a(var1, (String)null, "provid", zase.a(var2.getProviderId().a()));
      if (var2.getInstructions() != null) {
         this.a(var1, (String)null, "signinginstructionsset", "t");
         this.a(var1, (String)null, "signinginstructions", var2.getInstructions());
      }

      if (!var2.getShowSignedDate()) {
         this.a(var1, (String)null, "showsigndate", "f");
      }

      if (var2.getSigner() != null) {
         this.a(var1, "o", "suggestedsigner", var2.getSigner());
      }

      if (var2.getTitle() != null) {
         this.a(var1, "o", "suggestedsigner2", var2.getTitle());
      }

      if (var2.getEmail() != null) {
         this.a(var1, "o", "suggestedsigneremail", var2.getEmail());
      }

      if (var2.c != null) {
         this.a(var1, "o", "sigprovurl", var2.c);
      }

   }

   private void a(zcfx var1, SignatureLine var2) throws Exception {
      var1.b("o:signatureline");
      if (var2.d != null) {
         var1.a("addlxml", var2.d);
      }

      if (var2.getAllowComments()) {
         var1.a("allowcomments", "t");
      }

      if (var2.a != null) {
         var1.a("v:ext", var2.a);
      }

      var1.a("id", zase.a(var2.b.a()));
      var1.a("issignatureline", var2.isLine() ? "t" : "f");
      var1.a("provid", zase.a(var2.getProviderId().a()));
      if (var2.getInstructions() != null) {
         var1.a("signinginstructionsset", "t");
         var1.a("signinginstructions", var2.getInstructions());
      }

      if (!var2.getShowSignedDate()) {
         var1.a("showsigndate", "f");
      }

      if (var2.getSigner() != null) {
         var1.a("o:suggestedsigner", var2.getSigner());
      }

      if (var2.getTitle() != null) {
         var1.a("o:suggestedsigner2", var2.getTitle());
      }

      if (var2.getEmail() != null) {
         var1.a("o:suggestedsigneremail", var2.getEmail());
      }

      if (var2.c != null) {
         var1.a("o:sigprovurl", var2.c);
      }

      var1.b();
   }

   private Shape a(String var1, String var2) {
      Iterator var3 = this.a.a.getShapes().iterator();

      Shape var4;
      do {
         do {
            do {
               if (!var3.hasNext()) {
                  return null;
               }

               var4 = (Shape)var3.next();
            } while(var4.g == null);
         } while(!com.aspose.cells.b.a.zv.b(var4.g.a, var1));
      } while(!com.aspose.cells.b.a.zv.b(var4.g.b, var2) && !com.aspose.cells.b.a.zv.b(var4.g.c, var2));

      return var4;
   }

   private void a(zcfq var1, zcfq var2, zcfq var3, zcfq var4, zcfq var5, Comment var6) {
      String var7 = this.r(var6.getCommentShape());
      zcfg var8 = zass.a((zcfl)var1, "style");
      if (var8 != null) {
         var8.h = var7;
      } else {
         this.a((zcfl)var1, (String)null, "style", var7);
      }

      String var9 = this.q(var6.getCommentShape());
      if (var3 != null) {
         zass.a(var3, var9);
      } else {
         zcfl var14 = new zcfl(var1);
         var14.f = "x";
         var14.g = "Anchor";
         zass.a((zcfq)var14, var9);
         zass.a((zcfq)var2, (zcfq)var14, (zcfq)var4);
      }

      String var10;
      if (var5 != null) {
         var10 = "mso-direction-alt:auto";
         if (var6.getAutoSize()) {
            var10 = var10 + ";mso-fit-shape-to-text:t";
         }

         zcfg var11 = zass.a((zcfl)var5, "style");
         if (var11 != null) {
            var11.h = var10;
         } else {
            this.a((zcfl)var5, (String)null, "style", var10);
         }
      }

      var10 = this.a.n.a((Shape)var6.getCommentShape());
      if (var10 != null) {
         zcfl var13 = zase.b(var1, "fill");
         if (var13 != null) {
            zcfg var12 = zass.a((zcfl)var13, "relid");
            if (var12 != null) {
               var12.h = var10;
            } else {
               this.a((zcfl)var13, (String)null, "relid", var10);
            }
         }
      }

   }

   private void a(zcfl var1, String var2, String var3, String var4) {
      zcfg var5 = new zcfg(var1);
      var5.f = var2;
      var5.g = var3;
      var5.h = var4;
      var1.e().a(var5);
   }
}
